import React,{memo,useContext} from "react";
import { Button } from "antd";
import ThemeContext from "../ThemeContext";
//这种方式是函数组件最常用的方式
//方案二 【最常用】
function VoteFooter() {
    //获取到上下文中存储的所有信息，返回一个对象
    let {change} = useContext(ThemeContext)
    return <div className="footer">
        <Button type="primary" onClick={change.bind(null, 'sup')}>支持</Button>
        <Button type="primary" danger onClick={change.bind(null, 'opp')}>反对</Button>
    </div>
}

export default memo(VoteFooter)
